﻿using System;
using MoonSharp.Interpreter;
using UnityEngine;

namespace Lua
{
	// Token: 0x020002F5 RID: 757
	[MoonSharpUserData]
	public class Movement
	{
		// Token: 0x0600125D RID: 4701 RVA: 0x00081280 File Offset: 0x0007F480
		[MoonSharpHidden]
		public Movement(EntityBase e)
		{
			if (e == null)
			{
				Debug.LogError("Creating Movement with no entity");
			}
			this.entity = e;
			this.movement = e.movement;
			this.walk = this.movement.walkController;
		}

		// Token: 0x170002B9 RID: 697
		// (get) Token: 0x0600125E RID: 4702 RVA: 0x000812CD File Offset: 0x0007F4CD
		// (set) Token: 0x0600125F RID: 4703 RVA: 0x000812DA File Offset: 0x0007F4DA
		public float speed
		{
			get
			{
				return this.movement.maxSpeedBase;
			}
			set
			{
				this.movement.maxSpeedBase = value;
			}
		}

		// Token: 0x06001260 RID: 4704 RVA: 0x000812E8 File Offset: 0x0007F4E8
		public void MoveTowards(Vector3 point)
		{
			this.walk.MoveTowards(point.vector3);
		}

		// Token: 0x06001261 RID: 4705 RVA: 0x000812FB File Offset: 0x0007F4FB
		public void MoveDirection(Vector3 direction)
		{
			this.walk.MoveWorldDirection(direction.vector3);
		}

		// Token: 0x06001262 RID: 4706 RVA: 0x0008130E File Offset: 0x0007F50E
		public void Turn(float degrees)
		{
			this.entity.transform.Rotate(Vector3.up, degrees);
		}

		// Token: 0x040016CD RID: 5837
		private EntityBase entity;

		// Token: 0x040016CE RID: 5838
		private MovementCharacter movement;

		// Token: 0x040016CF RID: 5839
		private WalkController walk;
	}
}
